package qing.entity;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.NotBlank;

@Entity
@Table
public class Supply  extends AbstractEntity<String> {

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	private String id;	
	
	//貌似解决并发控制数据问题
	@Version
	private Integer version;
	
	private boolean deleted;
	
	//时间戳
	    @Column(updatable = false)
		@Temporal(value=TemporalType.TIMESTAMP)
		private Date dateCreated=new Date();;
		
		@NotBlank
		private String title;
		
		private String contact;
		
		private String phone;
		
		private String tel;
		
		private String addr;
		
		private int taxis=99;
		
		private String remark;
			
		
		@Column(updatable = false)
		private String adduser;


		
		
		@Override
		public String toString() {
			return "Supply [id=" + id + ", version=" + version + ", deleted=" + deleted + ", dateCreated=" + dateCreated
					+ ", title=" + title + ", contact=" + contact + ", phone=" + phone + ", tel=" + tel + ", addr="
					+ addr + ", taxis=" + taxis + ", remark=" + remark + ", adduser=" + adduser + "]";
		}


		

		public String getId() {
			return id;
		}




		public void setId(String id) {
			this.id = id;
		}




		public Integer getVersion() {
			return version;
		}


		public void setVersion(Integer version) {
			this.version = version;
		}


		public boolean isDeleted() {
			return deleted;
		}


		public void setDeleted(boolean deleted) {
			this.deleted = deleted;
		}


		public Date getDateCreated() {
			return dateCreated;
		}


		public void setDateCreated(Date dateCreated) {
			this.dateCreated = dateCreated;
		}


		public String getTitle() {
			return title;
		}


		public void setTitle(String title) {
			this.title = title;
		}


		public String getContact() {
			return contact;
		}


		public void setContact(String contact) {
			this.contact = contact;
		}


		public String getPhone() {
			return phone;
		}


		public void setPhone(String phone) {
			this.phone = phone;
		}


		public String getTel() {
			return tel;
		}


		public void setTel(String tel) {
			this.tel = tel;
		}


		public String getAddr() {
			return addr;
		}


		public void setAddr(String addr) {
			this.addr = addr;
		}


		public int getTaxis() {
			return taxis;
		}


		public void setTaxis(int taxis) {
			this.taxis = taxis;
		}


		public String getRemark() {
			return remark;
		}


		public void setRemark(String remark) {
			this.remark = remark;
		}


		public String getAdduser() {
			return adduser;
		}


		public void setAdduser(String adduser) {
			this.adduser = adduser;
		}		
		
		
	
	
}
